package com.nbufe.command.demo1;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Zan
 * @Create 2024/6/3 8:35
 * @ClassName: FBSettingWindow
 * @Description : TODO 请用一句话描述该类的功能
 */
public class FBSettingWindow {

    private String title;

    private List<FunctionButton> functionButtons = new ArrayList<>();

    public FBSettingWindow(String title) {
        this.title = title;
    }

    public void addFunctionButton(FunctionButton functionButton) {
        functionButtons.add(functionButton);
    }

    public void removeFunctionButton(FunctionButton functionButton) {
        functionButtons.remove(functionButton);
    }

    /**
     * 显示窗口命令
     */
    public void display() {
        System.out.println("显示该窗口包含的所有窗口命令");
        System.out.println("----------------------");
        for (FunctionButton functionButton : functionButtons) {
            System.out.println("这是 " + functionButton.getName() + " 按钮");
        }
        System.out.println("----------------------");
    }
}
